package com.tms.permission.controller;

import com.tms.permission.service.SystemPermissionService;
import com.tms.permission.service.SystemRoleService;
import com.tms.systemPermission.bean.SystemPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author：潘建冰
 * Package：com.tms.permission.controller
 * Project：TaskManageSystem
 * name：PermissionController
 * Date：2025/3/26  15:56
 */

@RestController
@RequestMapping("/permission/system")
public class PermissionSystemController {

    @Autowired
    private SystemPermissionService systemPermissionService;



    @GetMapping("/getPermissionCode")
    public List<String> getPermissionCode(@RequestParam String userId){
        return systemPermissionService.getPermissionCode(userId);
    }

    @GetMapping("/getRoleCode")
    public List<String> getRoleCode(@RequestParam String userId){
        return systemPermissionService.getRoleCode(userId);
    }

    @GetMapping("/getMenuTree")
    public List<SystemPermission> getMenuTree(@RequestParam String userId){
        return systemPermissionService.getMenuTree(userId);
    }
}
